/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.agenda.model.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Ronildo
 */
@Embeddable
public class AmTbMediEspePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "CD_ESPE")
    private short cdEspe;
    @Basic(optional = false)
    @NotNull
    @Column(name = "CD_MEDI")
    private int cdMedi;

    public AmTbMediEspePK() {
    }

    public AmTbMediEspePK(short cdEspe, int cdMedi) {
        this.cdEspe = cdEspe;
        this.cdMedi = cdMedi;
    }

    public short getCdEspe() {
        return cdEspe;
    }

    public void setCdEspe(short cdEspe) {
        this.cdEspe = cdEspe;
    }

    public int getCdMedi() {
        return cdMedi;
    }

    public void setCdMedi(int cdMedi) {
        this.cdMedi = cdMedi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) cdEspe;
        hash += (int) cdMedi;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AmTbMediEspePK)) {
            return false;
        }
        AmTbMediEspePK other = (AmTbMediEspePK) object;
        if (this.cdEspe != other.cdEspe) {
            return false;
        }
        if (this.cdMedi != other.cdMedi) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.agenda.model.entity.AmTbMediEspePK[ cdEspe=" + cdEspe + ", cdMedi=" + cdMedi + " ]";
    }
    
}
